import Mock from 'mockjs';

//产品详情，可以填充
const orderList = {
    "productID":/[A-Z0-9]{5,8}/,
    "productName":"@csentence(5,10)",
    "spec|1":["25g*10片/盒","5g/30袋","AMPN*10瓶+Z0501202","145g"],//规格
    "unit|1":["盒","瓶","套"],
    "num|1-20":1,
    "unitPrice|1-200.2":52,   //单价
    "pv":"@natural(100,99999)",
    "amount|100-10000.2":52.00,  //金额小计
    "pvTotal":function(){
        return this.pv+parseInt(Math.random()*1000) 
    }

}


const orderManger = {
    "data": {
        "list|10":[
            {
                "orderID":"@id",     //订单编号
                "customerID":'@natural(10000,99999)',     //顾客ID
                "customerName":"@cname",                  //顾客姓名
                "drawer|1":["随云","阿海","九尘"],         //开单人
                "coupon|1-200.2":20.0,           //优惠券
                "discount|1":['200.00','400.00','600.00'],        //折扣
                "eCoupon|1":['10.00','50.00','100.00','200.00'],  //电子优惠券
                "payAmount|1000-10000.2":52.00,     //实付金额
                'orderType|1':["VIP顾客自购","云商代购","补报单","团购单"],      //订单类型
                "paymentDate|1":[null,"@date(yyyy-MM-dd)"],        //付款日期
                "orderError|1":["已取消","待付款"],     //有付款时间的状态
                "orderSuccess|1":["待发货","已完成"],   //没有付款时间的状态
                "orderState":function(){      //订单状态
                    if(this.paymentDate){
                        return this.orderSuccess
                    }else{
                        return this.orderError
                    }
                },
                "distribution|1":["邮寄","自提"],
                "type":"化妆品",
                "name":"@ctitle",
                "spec":"25g*10片/盒",
                "unit":"盒",
                "num|1-20":20,
                "price|1-300.1-99":56.00,
                "pv":"@natural(1000,99999)",
                "yhunit|2-8":5,
                "balance":"每天",
                "deposit":"dfsdfdf"
            }
        ],
        "pageSize":10,
        "pageNo":1,
        "total":23
    },
    "resultCode": 0,
    "resultMsg": "success"
}

export {
    orderManger
}
